<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" session="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">
    <title>发货记录</title>

    <link href="${pageContext.request.contextPath}/static/css/common.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/css/bootstrap.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/css/select2.min.css"
    	  rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome-4.3.0/css/font-awesome.min.css"
          rel="stylesheet">
    <!-- jqgrid-->
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/custom.ui.jqgrid.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/style.css" rel="stylesheet">

    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/jquery.form.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/common.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/jqGrid/js/i18n/grid.locale-cn.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/jqGrid/js/minified/jquery.jqGrid.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/layer/layer.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/js/select2.min.js"></script>
	<script type="text/javascript"
            src="${pageContext.request.contextPath}/static/plugins/My97DatePicker/WdatePicker.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/global.js"></script>
    <style type="text/css">
        .main h5 a {
            position: absolute;
            right: 20px;
            font-size: 14px;
            bottom: 0px;
            display: inline-block;
            padding: 5px;
        }

        .table_list tbody tr {
            height: 35px;
            text-align: center;
        }
        .labe1{
        	width: 102px !important;
        }
        .labe2{
        	width: 90px !important;
        }
       	.divs{
       		padding-left:0px;
       		width: 170px;
       		*+width: 150px;
       	}
		.left ul li{
			
			*line-height:40px;
			
			*padding-left:20px;
		}
		
		.left ul li a, .left ul li a:hover{
			*color:#fff;
		}
		.wrapper{
			*margin-left:270px;
		}
		.form-group{
			*overflow: hidden;
		}
		.form-control{
			*padding:0;
		}
		.btn{
			*width:60px;
		}
		.btn_1{
			*position:relative;
			*left:20px;
		}
		.btn_2{
			*position:relative;
			*left:30px;
		}
		.lt{
			float:left;
		}
		.col-md-1{
			padding-left:0;
			*+padding-left:0;
			
			*+padding-right:0;
			*position:relative;

		}
		.col-md-3,.divs {
			*padding-right:0;
		}
		
		.ui-pg-button{
			*background:#ccc;
		}
		.form-lable{
			width:90px\9;
			*+width:70px;
		}
		
    </style>
</head>
<body view="menu-item-4142">
<jsp:include page="../../top.jsp"></jsp:include>
<div class="right">
    <div class="wrapper">
        <div class="panel panel-default">
            <div class="panel-heading">
                <span><strong>查询条件</strong></span>

                <div class="ibox-tools">
                    <a class="collapse-link"> <i class="fa fa-chevron-down"></i></a>
                    <a class="collapse-link  d-n"> <i class="fa fa-chevron-up"></i></a>
                </div>
            </div>
            <div class="panel-body">
                <form class="form-horizontal">
                    <div class="form-group">
			            
                      	<label class="labe2 col-md-1 lt form-lable" style="width: 110px;">操作内容：</label>
                        <div class="divs col-md-3 lt">
                            <input id="operationContent" name="operationContent" type="text" class="form-control"/>
                        </div>
                        
                        <label class="labe2 col-md-1 form-lable lt" >操作人：</label>
                        <div class="divs col-md-3 lt" >
                            <select name="operator" id="operator" class="form-control col-md-1"></select>
                        </div>
                        
                        <label class="labe2 col-md-1 form-lable lt" >发货时间：</label>
						<div class="divs col-sm-3 lt" >
                            <div class="input-group">
                                <input class="form-control col-md-1" name="sendTime" id='sendTime'
                                       onclick='WdatePicker()'/>
                            </div>
                        </div>	                        
                        <div class="col-md-1 form-action lt btn_1">
                            <button class="btn btn-success form-control" id="query">查询</button>
                        </div>
                        <div class="col-md-1 form-action lt btn_2">
                            <button class="btn btn-success form-control" id="resetForm">清空</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
	    <div class="jqGrid_wrapper">
	        <div id="jqGrid_operation" class="jg-grid">
	            <h1>发货记录</h1>
	            <div class="jqGrid_operation" id="action"></div>
	        </div>
	        <table id="jqGrid"></table>
	        <div id="jqGrid_paper"></div>
    	</div>
    </div>
</div>
<script>
    $(document).ready(
            function () {

                $.jgrid.defaults.styleUI = "Bootstrap";
                $("#jqGrid").jqGrid(
                        {
                            url: "${pageContext.request.contextPath}/admin/tlocks_haveSendList.action",
                            mtype: 'POST',
                            datatype: "json",
                            height: 362,
                            autowidth: true,
                            shrinkToFit: true,
                            rowNum: 10,
                            rowList: [10, 20, 30],
                            colNames: ['序号', '操作内容', '操作人', 'IP', '时间'],
                            colModel: [{
                                name: "SID",
                                index: "SID",
                                key: true,
                                hidden: true
                            }, {
                                name: 'COMM',
                                index: 'COMM'
                            }, {
                                name: 'CUSERNAME',
								width:30,
                                index: 'CUSERNAME'
                            },{
                                name: 'CIP',
								width:50,
                                index: 'CIP'
                            },{
                                name: 'CTIME1',
								width:50,
                                index: 'CTIME1'
                            }],
                            sortname: 'sid',
                            sortorder:'desc',
                            rownumbers: true,
                            jsonReader: {
                                root: 'rows',
                                page: "page",
                                total: 'total',
                                records: "records",
                                repeatitems: false
                            },
                            pager: "#jqGrid_paper",
                            viewrecords: true,
                            multiselect: true,
                            hidegrid: false,
                            loadComplete: function(){
                        		var re_records = Number($("#jqGrid").getGridParam('records'));
                        		var page = Number($("#jqGrid").getGridParam('page'));
                        		var rows=Number($("#jqGrid").getGridParam('rowNum'));
                        		var num = re_records-(page-1)*rows;
                        		if(num < rows)
                        		{
                        			for(var i=num;i<rows;i++){
                        				$("#jqGrid").jqGrid("addRowData",(i+1),
                                				{ "SID":"", "COMM":"", "CUSERNAME":"", "CIP":"", "CTIME1":""}
                        				,"");
                        			}
                        			$(".ui-paging-info").html(re_records-num+1 +" - "+re_records+"　共 "+re_records+" 条");
                        		}
                        	}
                        });
                $.post("${pageContext.request.contextPath}/admin/sysopt_list.action", function (data) {
		            $("#operator").empty();
		            $("#operator").append("<option value=''>请选择操作人</option>");
		            for (var i = 0; i < data.length; i++) {
		                $("#operator").append("<option value='" + data[i].sid + "'>" + data[i].uname + "</option>");
		            }
		            $("#operator").select2({
		                "placeholder": "请选择操作人",
		                "width": "100%"
		            })
		        }, "json");
                <!--查询-->
                jQuery("#query").click(query);
                jQuery("#resetForm").click(resetForm);
            });

    <!--刷新jqGrid表格数据-->
    function refreshGrid() {
        $("#jqGrid").trigger("reloadGrid");
    }
    function resetForm() {
        location.reload();
        return false;
    }
    function query() {
        var $operationContent = $("#operationContent").val();
        var $operator = $("#operator").val();
        var $sendTime = $("#sendTime").val();
        $("#jqGrid").jqGrid('setGridParam', {
            url: "${pageContext.request.contextPath}/admin/tlocks_haveSendList.action",
            postData: {
                'operationContent': $operationContent,
                'operator': $operator,
                'sendTime': $sendTime
            }, //发送数据
            page: 1
        }).trigger("reloadGrid"); //重新载入*/
        return false;
    }
</script>
</body>
</html>
